************************************
************************************
*** Main Analysis for Norway   	 ***
*** Edited by Tine Apr 19 2022   ***
************************************
************************************

*************************************************
* These files are needed for the file to run: 	*
* - prreddata.dta						        *
*************************************************


**************
*** Set up ***
**************


cd "/Volumes/GoogleDrive/My Drive/NYU/Projects/Norway/Data"

use "prreddata.dta", clear

set more off

*********************
*** Main Analyses ***
*********************

***********
* Table 1 *
***********

* Analyses *
eststo taxyrfetrend: xi: reg incometaxrate difindif i.time i.Kommuner*trend, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "Yes"
	estadd local controls "No"



eststo taxyrfe: xi: reg incometaxrate difindif  i.time i.Kommuner, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"


eststo taxyrsim: xi: reg incometaxrate difindif after forcedswitch, robust cluster(Kommuner)
	estadd local yearfe "No"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local controls "No"

eststo taxyrcontrols: xi: reg incometaxrate difindif after forcedswitch areafe residents ethnicfixedcap fisheriesfixedcap agriculturecap dissentersfecap chickenscap wheatcap potatoescap i.region i.time , robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local controls "Yes"
	
	
* used for Table A.3 *
eststo taxyrfenoleft: xi: reg incometaxrate difindif  i.time i.Kommuner if noleft1919==1, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"
	

* Table *


label variable difindif "Plurality before 1919 x After 1919 (Dif in Dif Estimate)"
label variable forcedswitch "Plurality before 1919"
label variable after "After 1919"
	
estout taxyrfe taxyrfetrend taxyrsim taxyrcontrols using norwaymaintaxresults.tex, replace /*
	*/cells("b(star fmt(2))" se(par fmt(2))) keep(difindif after forcedswitch)/*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)

estout taxyrfe taxyrfetrend taxyrsim taxyrcontrols using norwaymaintaxresultsstats.tex, replace /*
	*/cells("b(star fmt(3))" se(par fmt(3)))  /*
	*/ drop(*)/*
	*/stats(yearfe unitfe trend controls N_clust N , labels("Time Fixed Effects" "Municipality Fixed Effects" "Municipality-Specific Time Trends" "1891 Controls Included" "Number of Municipalities" "Total Observations") fmt(0 0 0 0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label varlabels(_cons Constant)

	

************
* Figure 2 *
************


local years "1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923"

foreach x in `years'{
	gen treat`x' = 0
	replace treat`x' = 1 if time>`x'
}



* placebo *
	
local treat "treat1912 treat1913 treat1914 treat1915 treat1916 treat1917 treat1918 treat1919 treat1920 treat1921 treat1922 treat1923"
foreach y in `treat'{
quietly xi: reg incometaxrate c.forcedswitch#c.`y'  i.time i.Kommuner, robust cluster(Kommuner) 
estimate store incometaxrate_`y'
}



graph drop _all


coefplot (incometaxrate_treat1912) (incometaxrate_treat1913) (incometaxrate_treat1914) (incometaxrate_treat1915)  (incometaxrate_treat1916) (incometaxrate_treat1917)/*
	*/(incometaxrate_treat1918)  (incometaxrate_treat1919) (incometaxrate_treat1920) (incometaxrate_treat1921) (incometaxrate_treat1922), /*
	*/vertical keep(c.forcedswitch#c.treat1912 c.forcedswitch#c.treat1913 c.forcedswitch#c.treat1914 c.forcedswitch#c.treat1915 c.forcedswitch#c.treat1916 c.forcedswitch#c.treat1917 /*
	*/ c.forcedswitch#c.treat1918 c.forcedswitch#c.treat1919 c.forcedswitch#c.treat1920 c.forcedswitch#c.treat1921 c.forcedswitch#c.treat1922) yline(0) title("") /*
	*/legend(off) /*
	*/ coeflabels(c.forcedswitch#c.treat1923 = "1924" c.forcedswitch#c.treat1922 = "1923" c.forcedswitch#c.treat1921 = "1922" c.forcedswitch#c.treat1920 = "1921" c.forcedswitch#c.treat1919 = "1920" c.forcedswitch#c.treat1918 = "1919" c.forcedswitch#c.treat1917 = "1918" /*
	*/ c.forcedswitch#c.treat1916 = "1917" c.forcedswitch#c.treat1915 = "1916" c.forcedswitch#c.treat1914 = "1915" c.forcedswitch#c.treat1913 = "1914" c.forcedswitch#c.treat1912 = "1913") /*
	*/ xscale(range(0 9.5)) xtitle("Year") xline(7.5, lwidth(thin) lpattern(dash))  ytitle("Placebo Estimates for Tax Rate") ylabel(-1(0.5)1.5) yscale(range(-1 1.5)) offset(0.01) levels(95 90) scheme(Lean2) msymbol(S) 


graph export taxpartrends.pdf, replace



************
* Table 2  *
************

xtset Kommuner time


eststo m1: xtreg poornew  difindif i.time , fe robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"
	estadd local childmort "No"
	estadd local pop "No"
	

eststo m2: xi: reg poornew difindif i.Kommuner*trend i.time i.Kommuner,  robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "Yes"
	estadd local controls "No"
		estadd local childmort "No"
	estadd local pop "No"
	
eststo m3: xtreg poornew forcedswitch after difindif, /*
	*/robust cluster(Kommuner)
	estadd local yearfe "No"
	estadd local unitfe "No"
		estadd local trend "No"
	estadd local controls "No"
		estadd local childmort "No"
	estadd local pop "No"
	

eststo m4: xtreg poornew forcedswitch after difindif /*
	*/  residents ethnicfixedcap fisheriesfixedcap agriculturecap dissentersfecap chickenscap wheatcap potatoescap  i.region i.time, /*
	*/robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local controls "Yes"
		estadd local childmort "No"
	estadd local pop "No"
	
	
eststo m7: xtreg poornew difindif i.time if noleft1919==1, fe robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"
	estadd local pop "Yes"
	
	
eststo m8: xtreg poornew difindif i.time percchilddeath popint, fe robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"
	estadd local childmort "Yes"
	estadd local pop "Yes"
	
* Table *
	

estout m1 m2 m3 m4 m8 using poorrelief.tex, replace /*
	*/cells("b(star fmt(3))" se(par fmt(3))) keep(difindif after forcedswitch) order(difindif forcedswitch after)/*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)

estout m1 m2 m3 m4 m8 using poorreliefstats.tex, replace /*
	*/cells("b(star fmt(3))" se(par fmt(3)))  /*
	*/ drop(*)/*
	*/stats(yearfe unitfe trend controls pop childmort N_clust N, labels("Time Fixed Effects" "Municipality Fixed Effects" "Municipality-Specific Time Trends" "1891 Controls Included" "Control for Population Size" "Control for Child Mortality" "Number of Municipalities" "Total Observations") fmt(0 0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label varlabels(_cons Constant)	
	
***************
*** Table 3 ***
***************

cap drop after difindif

gen after = .
	replace after = 0 if time <1919 & time!= .
	replace after = 1 if time >=1919 & time!= .
	
gen difindif = forcedswitch*after



* Analyses *

xtset Kommuner time

eststo turnoutmain: xtreg turnout difindif i.time, fe robust cluster (Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local regfe "No"
	estadd local controls "No"
	
eststo turnouttrend: xi: reg turnout difindif i.time i.Kommuner*trend, robust cluster (Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "Yes"
	estadd local regfe "No"
	estadd local controls "No"
	
	

eststo turnoutsim: xtreg turnout difindif after forcedswitch, robust cluster (Kommuner)
	estadd local yearfe "No"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local regfe "No"
	estadd local controls "No"
	
eststo turnoutcontrols: xtreg turnout difindif after forcedswitch areafe residents ethnicfixedcap fisheriesfixedcap agriculturecap dissentersfecap chickenscap wheatcap potatoescap i.time i.region, robust cluster (Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local regfe "No"
	estadd local controls "Yes"

eststo turnoutnoleft: xtreg turnout difindif i.time if noleft1919==1, fe robust cluster (Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local regfe "No"
	estadd local controls "No"
	
	
* Table *
	

label variable difindif "Plurality before 1919 x After 1919 (Dif in Dif Estimate)"
label variable forcedswitch "Plurality before 1919"
label variable after "After 1919"

estout turnoutmain turnouttrend turnoutsim turnoutcontrols using turnout.tex, replace /*
	*/cells("b(star fmt(2))" se(par fmt(2))) keep(difindif forcedswitch after)/*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)

estout turnoutmain turnouttrend turnoutsim turnoutcontrols using turnoutstats.tex, replace /*
	*/cells("b(star fmt(3))" se(par fmt(3)))  /*
	*/ drop(*)/*
	*/stats(yearfe unitfe trend controls N_clust N, labels("Time Fixed Effects" "Municipality Fixed Effects" "Municipality-Specific Time Trend" "1891 Controls Included" "Number of Municipalities" "Total Observations") fmt(0 0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label varlabels(_cons Constant)
	
	
	

***************
*** Table 4 ***
***************



eststo leftsharefe: xi: reg leftshare difindif i.time i.Kommuner, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"
	
eststo leftsharetrend: xi: reg leftshare difindif  i.Kommuner*trend i.time i.Kommuner, robust cluster(Kommuner)
	estadd local yearfe "No"
	estadd local unitfe "Yes"
	estadd local trend "Yes"
	estadd local controls "No"
	

eststo leftsharesimp: xi: reg leftshare difindif after forcedswitch, robust cluster(Kommuner)
	estadd local yearfe "No"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local controls "No"
	
eststo leftsharecontrols: xi: reg leftshare difindif after forcedswitch areafe residents ethnicfixedcap fisheriesfixedcap agriculturecap dissentersfecap chickenscap wheatcap potatoescap i.region i.time, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local controls "Yes"

eststo leftsharenoleft: xi: reg leftshare difindif i.time i.Kommuner if noleft==1, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"

eststo leftsharestrongleft: xi: reg leftshare difindif i.time i.Kommuner if strongleft==1, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"
	

* Table *

estout leftsharefe  leftsharetrend leftsharesimp leftsharecontrols leftsharenoleft leftsharestrongleft using leftshare.tex, replace /*
	*/cells("b(star fmt(2))" se(par fmt(2))) keep(difindif after forcedswitch)/*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)

estout leftsharefe  leftsharetrend leftsharesimp leftsharecontrols leftsharenoleft leftsharestrongleft using leftsharestats.tex, replace /*
	*/cells("b(star fmt(3))" se(par fmt(3)))  /*
	*/ drop(*)/*
	*/stats(yearfe unitfe trend controls N_clust N, labels("Time Fixed Effects" "Municipality Fixed Effects" "Municipality-Specific Time Trends" "1891 Controls Included" "Number of Municipalities" "Total Observations") fmt(0 0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label varlabels(_cons Constant)
	

****************
*** Appendix ***
****************
	
	
*************
* Table A.2 *
*************


label var incometaxrate "Tax Rate Before 1919 Reform"
label var poornew "New People on Poor Relief Before 1919 Reform"
label var turnout "Turnout Before 1919 Reform (\%)"
label var leftshare "Municipal Council Left Party Seat Share Before 1919 Reform (\%)"


local controllist "residents fisheriesfixedcap agriculturecap  ethnicfixedcap dissentersfecap chickenscap wheatcap potatoescap  areafe"  

local outcomes "poornew turnout leftshare"


eststo controls: estpost ttest `controllist'  if time==1919, by(forcedswitch)
eststo incometaxrate: estpost ttest incometaxrate  if time<=1919, by(forcedswitch)
eststo outcomes: estpost ttest `outcomes'  if time<1919, by(forcedswitch)

* Table *

estout controls using controls.tex, replace /*
	*/ cells("mu_1(fmt(3)) mu_2(fmt(3)) b(fmt(2)) se(fmt(2))") mlabels(none) collabels(none)/*
	*/style(tex) label
	
estout incometaxrate using incometaxratedesc.tex, replace /*
	*/ cells("mu_1(fmt(2)) mu_2(fmt(2)) b(fmt(2)) se(fmt(2))") mlabels(none) collabels(none)/*
	*/style(tex) label
	
estout outcomes using outcomesdesc.tex, replace /*
	*/ cells("mu_1(fmt(2)) mu_2(fmt(2)) b(fmt(2)) se(fmt(2))") mlabels(none) collabels(none)/*
	*/style(tex) label
	
*************	
* Table A.3 * 	
*************

* Note: Analyses are part of main analysis section
	
	
estout taxyrfenoleft m7 turnoutnoleft using noleft.tex, replace /*
	*/cells("b(star fmt(3))" se(par fmt(3))) keep(difindif ) order(difindif)/*
	*/mlabels(none) collabels(none) varlabels(difindif "Plurality before 1919 x After 1919 (Dif in Dif Estimate)")/*
	*/style(tex) label /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)
	
estout taxyrfenoleft m7 turnoutnoleft using noleftstats.tex, replace /*
	*/ drop(*)/*
	*/stats(yearfe unitfe trend controls N_clust N, labels("Time Fixed Effects" "Municipality Fixed Effects" "Municipality-Specific Time Trends" "1891 Controls Included" "Number of Municipalities" "Total Observations") fmt(0 0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label varlabels(_cons Constant)
	
******************
*** Table A. 4 ***
******************


local treat "treat1912 treat1913 treat1914 treat1915 treat1916 treat1917 treat1918 treat1919 treat1920 treat1921 treat1922 treat1923"
foreach y in `treat'{
cap drop didplac
gen didplac = forcedswitch*`y'
quietly reg incometaxrate didplac  i.time i.Kommuner, robust cluster(Kommuner) 
estimate store incometaxrate_`y'
}


* Table *
estout  incometaxrate_treat1918 incometaxrate_treat1919 incometaxrate_treat1920 incometaxrate_treat1921 incometaxrate_treat1922 using taxrateplace2.tex, replace /*
	*/ cells("b(star fmt(3))" se(par fmt(3))) /*
	*/ keep(didplac) /*
	*/ varlabels(didplac "Dif in Dif Estimate")/*
	*/mlabels(none) collabels(none)/*
	*/style(tex) /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)
	
estout incometaxrate_treat1913 incometaxrate_treat1914 incometaxrate_treat1915 incometaxrate_treat1916 incometaxrate_treat1917  using taxrateplace1.tex, replace /*
	*/ cells("b(star fmt(3))" se(par fmt(3))) /*
	*/ keep(didplac) /*
	*/ varlabels(didplac "Dif in Dif Estimate") /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)

estout incometaxrate_treat1918 incometaxrate_treat1919 incometaxrate_treat1920 incometaxrate_treat1921 incometaxrate_treat1922 using taxrateplacestats2.tex, replace /*
	*/ drop(*) /*
	*/ stats(N_clust N, labels( "Number of Municipalities" "Total Observations") fmt(0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) 
	
estout incometaxrate_treat1913 incometaxrate_treat1914 incometaxrate_treat1915 incometaxrate_treat1916 incometaxrate_treat1917 using taxrateplacestats1.tex, replace /*
	*/ drop(*) /*
	*/ stats(N_clust N, labels( "Number of Municipalities" "Total Observations") fmt(0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) 

	
*************	
* Table A.5 *
*************

drop treat1912-treat1923

local years "1900 1905 1910 1915 1920"

foreach x in `years'{
	gen treat`x' = 0
	replace treat`x' = 1 if time>=`x'
}


*Placebo *

local treat "treat1900 treat1905 treat1910 treat1915"
foreach y in `treat'{
cap drop didplac
gen didplac = forcedswitch*`y'
reg poornew didplac  i.Kommuner i.time if time!=1920, robust cluster(Kommuner) 
estimate store poornew_`y'
}


* actual *

cap drop didplac
gen didplac = forcedswitch*treat1920
eststo poornew_treat1920: reg poornew didplac i.Kommuner i.time, robust cluster(Kommuner) 

* Table *

estout poornew_treat1905 poornew_treat1910 poornew_treat1915 poornew_treat1920 using poornewplace.tex, replace /*
*/ cells("b(star fmt(3))" se(par fmt(3))) /*
	*/ keep(didplac) /*
		*/ varlabels(didplac "Dif in Dif Estimate") /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)
	
	
	
estout poornew_treat1905 poornew_treat1910 poornew_treat1915 poornew_treat1920 using poornewplacestats.tex, replace /*
	*/ drop(*) /*
	*/ stats(N_clust N, labels( "Number of Municipalities" "Total Observations") fmt(0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) 
	
*************	
* Table A.6 *
*************

drop treat1910-treat1920

local years "1910 1913 1916 1919 1922"

foreach x in `years'{
	gen treat`x' = 0
	replace treat`x' = 1 if time>=`x'
}

	
* Placebo *

local treat "treat1910 treat1913 treat1916 treat1922"
foreach y in `treat'{
cap drop didplac
gen didplac = forcedswitch*`y'
eststo `y': quietly reg turnout  didplac i.time i.Kommuner if time!=1919, robust cluster(Kommuner) 
}


* Actual *

cap drop didplac
gen didplac = forcedswitch*treat1919
eststo treat1919: quietly reg turnout  didplac i.time i.Kommuner, robust cluster(Kommuner) 


* Table *
estout  treat1913 treat1916 treat1919 treat1922 using turnoutplace.tex, replace/*
	*/ cells("b(star fmt(3))" se(par fmt(3))) /*
	*/keep(didplac)  /*
	*/mlabels(none) collabels(none)/*
	*/style(tex)  varlabels(didplac "Dif in Dif Estimate")/*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)
		
estout treat1913 treat1916 treat1919 treat1922 using turnoutplacestats.tex, replace /*
	*/ drop(*) /*
	*/ stats(N_clust N, labels( "Number of Municipalities" "Total Observations") fmt(0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) 
	
	
	
**************	
* Figure A.2 *
**************

drop treat1910-treat1922

local years "1913 1916 1919 1922"

foreach x in `years'{
	gen treat`x' = 0
	replace treat`x' = 1 if time>=`x'
}


local treat "treat1913 treat1916 treat1922"
foreach y in `treat'{
quietly xi: reg leftshare c.forcedswitch#c.`y' i.Kommuner i.time if time!=1919, robust cluster(Kommuner) 
estimate store leftshare_`y'
estadd local unitfe "Yes"
}

eststo leftshare_treat1919: reg leftshare c.forcedswitch#c.treat1919 i.Kommuner i.time, robust cluster(Kommuner) 


graph drop _all


coefplot (leftshare_treat1913) (leftshare_treat1916) (leftshare_treat1919) (leftshare_treat1922), /*
	*/vertical keep(c.forcedswitch#c.treat1913 c.forcedswitch#c.treat1916 c.forcedswitch#c.treat1919 c.forcedswitch#c.treat1922) yline(0) title("") /*
	*/legend(off) /*
	*/ coeflabels(c.forcedswitch#c.treat1922 = "1922" c.forcedswitch#c.treat1919 = "1919" c.forcedswitch#c.treat1916 = "1916" c.forcedswitch#c.treat1913 = "1913") /*
	*/  xtitle("Year")  ytitle("Left Share") ylabel(-10(1)1.5) yscale(range(-1 1.5)) offset(0.01) levels(95 90) scheme(Lean2) msymbol(S)

graph export leftsharepartrends.pdf, replace
	
	
*************
* Table A.7 *
*************

local treat "treat1913 treat1916 treat1922"
foreach y in `treat'{
cap drop didplac
gen didplac = forcedswitch*`y'
eststo leftshare_`y': quietly reg leftshare didplac i.time i.Kommuner if time!=1919,robust cluster(Kommuner) 
}


* Actual *

cap drop didplac
gen didplac = forcedswitch*treat1919
eststo leftshare_treat1919: quietly reg leftshare  didplac i.time i.Kommuner,robust cluster(Kommuner) 


* Table *


estout leftshare_treat1916 leftshare_treat1919 leftshare_treat1922 using leftshareplace.tex, replace /*
	*/ keep(didplac) /*
	*/ cells("b(star fmt(3))" se(par fmt(3))) /*
	*/varlabels(didplac "Dif in Dif Estimate")/*
	*/mlabels(none) collabels(none)/*
	*/style(tex) /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)
	
estout leftshare_treat1916 leftshare_treat1919 leftshare_treat1922 using leftshareplacestats.tex, replace /*
	*/ drop(*) /*
	*/ stats(N_clust N, labels("Number of Municipalities" "Total Observations") fmt(0 0 0 0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) 
	

	
*************	
* Table A.8 *
*************

cap drop after difindif

gen after = .
	replace after = 0 if time <=1919 & time!= .
	replace after = 1 if time >1919 & time!= .
	
gen difindif = forcedswitch*after

label variable difindif "Plurality before 1919 x After 1919 (Dif in Dif Estimate)"
label variable after "After 1919"

* Analyses *
eststo taxlyrfetrend: xi: reg taxlead difindif i.time i.Kommuner*trend, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "Yes"
	estadd local controls "No"



eststo taxlyrfe: xi: reg taxlead difindif  i.time i.Kommuner, robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "Yes"
	estadd local trend "No"
	estadd local controls "No"


eststo taxlyrsim: xi: reg taxlead difindif after forcedswitch, robust cluster(Kommuner)
	estadd local yearfe "No"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local controls "No"

eststo taxlyrcontrols: xi: reg taxlead difindif after forcedswitch areafe residents ethnicfixedcap fisheriesfixedcap agriculturecap dissentersfecap  chickenscap wheatcap potatoescap  i.region i.time , robust cluster(Kommuner)
	estadd local yearfe "Yes"
	estadd local unitfe "No"
	estadd local trend "No"
	estadd local controls "Yes"


* Table *
	
estout taxlyrfe taxlyrfetrend taxlyrsim taxlyrcontrols using norwaymaintaxlresults.tex, replace /*
	*/cells("b(star fmt(2))" se(par fmt(2))) keep(difindif after forcedswitch)/*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label /*
	*/starlevels(+ 0.1 * 0.05 ** 0.01 *** 0.001)

estout taxlyrfe taxlyrfetrend taxlyrsim taxlyrcontrols using norwaymaintaxlresultsstats.tex, replace /*
	*/cells("b(star fmt(3))" se(par fmt(3)))  /*
	*/ drop(*)/*
	*/stats(yearfe unitfe trend controls N_clust N , labels("Time Fixed Effects" "Municipality Fixed Effects" "Municipality-Specific Time Trends" "1891 Controls Included" "Number of Municipalities" "Total Observations") fmt(0 0 0 0 0)) /*
	*/mlabels(none) collabels(none)/*
	*/style(tex) label varlabels(_cons Constant)

